home *** CD-ROM | disk | FTP | other *** search
Text File | 2004-09-30 | 50.2 KB | 1,821 lines |
- function ext_XML_GET_TEXT()
- {
- return this.firstChild.nodeType != 3 ? null : this.firstChild.nodeValue;
- }
- function ext_XML_SET_TEXT(text)
- {
- this.firstChild.nodeValue = text;
- }
- function ActivityInfoItem()
- {
- }
- function ActivityInfo()
- {
- }
- function Queue()
- {
- this.q = new Array();
- }
- function setVisible(bIsVisible)
- {
- hideDialogs();
- this._visible = bIsVisible;
- videoPlayer.stopVideo();
- videoPlayer.unloadVideo();
- audioPlayer.reset();
- }
- function hideDialogs()
- {
- modelDialog._visible = false;
- zoomWin._visible = false;
- }
- function setActivityNumber(num)
- {
- var tmc = actBullet.content;
- trace(tmc);
- var tf = layoutInfo.actBulletTextFormat;
- tmc.embedFonts = true;
- tmc.border = false;
- tmc.color = layoutInfo.actBulletTextColor;
- tmc.autoSize = "center";
- tmc.type = "dynamic";
- tmc.selectable = false;
- tmc.text = num;
- tmc.setTextFormat(tf);
- }
- function init()
- {
- if(PMSI.NavKey.getCourse().toLowerCase() == "c1")
- {
- btnToggleLang._visible = false;
- }
- btnRefWin.isMoveable = true;
- createTextField("score",10,0,0,0,0);
- score.embedFonts = true;
- score.selectable = false;
- modelDialog._visible = false;
- modelDialog.swapDepths(1201);
- zoomWin._visible = false;
- debug._visible = true;
- actBullet.createTextField("content",1,0,0,0,0);
- var tmc = actBullet.content;
- trace(tmc);
- var tf = layoutInfo.actBulletTextFormat;
- tmc.embedFonts = true;
- tmc.border = false;
- tmc.color = layoutInfo.actBulletTextColor;
- tmc.autoSize = "center";
- tmc.type = "dynamic";
- tmc.selectable = false;
- tmc.text = "12";
- tmc.setTextFormat(tf);
- tmc._x = 0;
- tmc._y = -1;
- btnRefWin._visible = false;
- loader.onComplete = function()
- {
- trace("Finished loading");
- };
- loader.setQueue(templateQueue);
- loader.start();
- }
- function hideAll()
- {
- }
- function setActivityInfo(ai)
- {
- videoNote.removeMovieClip();
- videoPlayer.stopVideo();
- videoPlayer.unloadVideo();
- hideDialogs();
- btnRefWin._visible = false;
- mediaFrame._visible = false;
- this.hasMediaFrame = false;
- this.hasVideoPlayer = false;
- this.hasAudioPlayer = false;
- score.text = "";
- audioPlayer.reset();
- var i = 0;
- while(i < templateList.length)
- {
- this[templateList[i].name]._visible = false;
- i++;
- }
- this.ai = ai;
- var type = activityTypes[ai.type];
- actBullet.content.autoSize = "center";
- setActivityNumber(ai.activityNumber.text);
- trace(actBullet.content.text);
- if(ai.artFile)
- {
- scriptTrace._visible = false;
- mediaFrame._visible = true;
- mediaFrame.showArt();
- mediaFrame.attachImage(artPath + "/" + ai.artFile.text);
- this.hasMediaFrame = true;
- }
- else
- {
- mediaFrame._visible = false;
- }
- if(ai.videoFile)
- {
- this.hasVideoPlayer = true;
- this.hasMediaFrame = true;
- videoPlayer.loadVideoClip(videoPath + "/" + fixVideoName(ai.videoFile.text));
- trace("VIDEO PATH!!!: " + videoPath + "/" + fixVideoName(ai.videoFile.text));
- videoPlayer._visible = true;
- mediaFrame._visible = true;
- scriptTrace._visible = true;
- mediaFrame.showScript();
- mediaFrame.setScriptWindowVisible(PMSI.scriptWindowVisible != null ? PMSI.scriptWindowVisible : true);
- tallLine._visible = false;
- actBullet._y = videoPlayer._y + videoPlayer._height / 2 + 10;
- mediaFrame.scriptFile = getScriptFilenameFix();
- mediaFrame.scriptAudioFile = getAudioFilenameFix();
- loadScriptText(ai.videoScriptFile.text);
- }
- else
- {
- tallLine._visible = true;
- actBullet._y = actBulletPosition.topy;
- videoPlayer._visible = false;
- scriptTrace._visible = false;
- }
- if(ai.audioFile)
- {
- this.hasAudioPlayer = true;
- audioPlayer._visible = true;
- var sndFile = audioPath + "/" + ai.audioFile.text;
- trace(sndFile);
- audioPlayer.loadSoundFile(sndFile);
- }
- else
- {
- audioPlayer._visible = false;
- }
- if(ai.audioScriptFile)
- {
- actBullet._y = actBulletPosition.topy;
- this.hasAudioPlayer = true;
- this.hasMediaFrame = true;
- mediaFrame._visible = true;
- scriptTrace._visible = true;
- mediaFrame.showScript();
- mediaFrame.setScriptWindowVisible(PMSI.scriptWindowVisible != null ? PMSI.scriptWindowVisible : true);
- tallLine._visible = true;
- mediaFrame.scriptFile = ai.audioScriptFile.text;
- mediaFrame.scriptAudioFile = getAudioFilenameFix();
- trace("\taudioScriptFile: " + ai.audioScriptFile.text);
- loadAudioScriptText(ai.audioScriptFile.text);
- }
- if(ai.audioFile)
- {
- answerBtn._x = actAnswerPosition.pos2_x;
- answerBtn._y = actAnswerPosition.pos2_y;
- }
- else
- {
- answerBtn._x = actAnswerPosition.pos1_x;
- answerBtn._y = actAnswerPosition.pos1_y;
- }
- if(parseInt(ai.type.text) != activityTypes.MATCH && ai.artFile == null && ai.wordBank != null && parseInt(ai.type.text) != activityTypes.TABLE)
- {
- trace("*!*!:: THIS SHOULD GET A WORD LIST");
- trace("\ttype: " + ai.type);
- mediaFrame._visible = true;
- mediaFrame.showWordlist(ai.wordBank.word);
- this.hasMediaFrame = true;
- }
- mediaFrame.setSmallFrame(this.hasAudioPlayer && this.hasMediaFrame && !this.hasVideoPlayer,ai.audioScriptFile != null);
- scriptTrace.setSmallFrame(this.hasAudioPlayer && this.hasMediaFrame && !this.hasVideoPlayer);
- this.currentActivity = this[type];
- this[type]._visible = true;
- answerBtn.tabIndex = 10000;
- answerBtn._visible = true;
- actNumber_mc._visible = true;
- actBullet._visible = true;
- this[type].btnRefWin = btnRefWin;
- if(ai.type.text == "7")
- {
- initStageForUnitVideos();
- }
- return this[type].setActivityInfo(ai);
- }
- function loadScriptText(url)
- {
- scriptTrace.loadXML(scriptPath + "/" + getScriptFilenameFix());
- }
- function loadAudioScriptText(url)
- {
- scriptTrace.loadXML(scriptPath + "/" + url);
- }
- function getScriptFilenameFix()
- {
- return ai.videoScriptFile != null ? ai.videoScriptFile.text : ai.audioScriptFile.text;
- }
- function getAudioFilenameFix()
- {
- var sf = ai.videoScriptFile != null ? ai.videoScriptFile.text : ai.audioScriptFile.text;
- return sf.substring(0,sf.lastIndexOf(".")) + ".mp3";
- }
- function fixVideoName(url, character)
- {
- return url;
- }
- function setFeedBack(correct, outof)
- {
- trace("setting feedback");
- var isScr = ai.isScoreable.text != "y" ? false : true;
- PMSI.Session.score.incrementActivitiesAttempted(isScr);
- PMSI.Session.score.incrementQuestionsAttempted(outof);
- PMSI.Session.score.incrementQuestionsCorrect(correct);
- PMSI.Session.scoring.setActivityScore(correct,outof,isScr);
- score.autoSize = true;
- if(isScr)
- {
- score.text = correct != outof ? "Try Again" : "Correct";
- score.setTextFormat(layoutInfo.actFeedbackTextFormat);
- }
- score._y = answerBtn._y + 5;
- score._x = answerBtn._x - score._width - 20;
- if(!isScr && !(ai.questions.question instanceof Array) && ai.questions.question.correctAnswer != null)
- {
- var mdl = "";
- if(ai.questions.question.correctAnswer instanceof Array)
- {
- var i = 0;
- while(i < ai.questions.question.correctAnswer.length)
- {
- mdl += ai.questions.question.correctAnswer[i].text.trim() + "\n\n";
- i++;
- }
- showModelDialog(mdl);
- }
- else
- {
- showModelDialog(ai.questions.question.correctAnswer);
- }
- }
- else if(!isScr && ai.model == null && ai.questions.question[0].model == null || !isScr && ai.questions.question[0].correctAnswer != null)
- {
- var mdl = "";
- var i = 0;
- while(i < ai.questions.question.length)
- {
- if(ai.questions.question[i].correctAnswer != null)
- {
- mdl += i + 1 + ". ";
- if(ai.questions.question[i].questionText != null && ai.type.text != "2")
- {
- mdl += ai.questions.question[i].questionText + "\n";
- }
- mdl += ai.questions.question[i].correctAnswer.text.trim() + "\n\n";
- }
- i++;
- }
- if(mdl == "")
- {
- showModelDialog("[No model supplied]");
- }
- else
- {
- showModelDialog(mdl);
- }
- }
- else if(!isScr)
- {
- showModelDialog(ai.model.text.trim());
- }
- }
- function showModelDialog(model)
- {
- modelDialog.model_txt.scroll = 0;
- modelDialog.model_txt.text = model;
- modelDialog._visible = true;
- modelDialog.centerDialog();
- }
- function loadActivity(url)
- {
- loadingBox._visible = true;
- var fn = "activities/data/" + url;
- trace("XML File full filename: " + fn);
- actInfo.onLoad = actOnLoad;
- actInfo.load(fn);
- Mouse.show();
- }
- function actOnLoad()
- {
- setActivityInfo(actInfo);
- answerBtn.enabled = true;
- zoomWin._visible = false;
- }
- function setActivityList(actlist)
- {
- this.actlist = actlist;
- actNumber_mc.setActivityList(actlist);
- trace("Listing Activities");
- var i = 0;
- while(i < actlist.length)
- {
- trace("\t" + actlist[i]);
- i++;
- }
- }
- function onRender()
- {
- loadingBox._visible = false;
- }
- function closeRecorder()
- {
- mediaFrame.closeRecorder();
- }
- function toggleLang()
- {
- currentActivity.toggleLang();
- }
- function setRefWinVisible(bIsVisible)
- {
- if(refWin == null)
- {
- this.attachMovie("refWin","refWin",2000);
- }
- refWin._x = 10;
- refWin._y = 10;
- refWin._visible = bIsVisible;
- }
- function testRefWin()
- {
- trace("Setting refWin to visible");
- setRefWinVisible(true);
- }
- function showRefWinButton(x, y)
- {
- btnRefWin._x = x;
- btnRefWin._y = y;
- btnRefWin._visible = true;
- if(refWin == null)
- {
- this.attachMovie("refWin","refWin",2000);
- }
- refWin._visible = false;
- }
- function initStageForUnitVideos()
- {
- actNumber_mc._visible = false;
- actBullet._visible = false;
- answerBtn._visible = false;
- shortLine._visible = false;
- tallLine._visible = false;
- audioPlayer._visible = false;
- this.hasVideoPlayer = true;
- this.hasMediaFrame = true;
- videoPlayer.loadVideoClip(videoPath + "/" + fixVideoName(ai.videoFile.text));
- trace("VIDEO PATH!!!: " + videoPath + "/" + fixVideoName(ai.videoFile.text));
- videoPlayer._visible = true;
- mediaFrame._visible = true;
- scriptTrace._visible = true;
- mediaFrame.showScript();
- mediaFrame.setScriptWindowVisible(PMSI.scriptWindowVisible != null ? PMSI.scriptWindowVisible : true);
- actBullet._y = videoPlayer._y + videoPlayer._height / 2 + 10;
- mediaFrame.scriptFile = getScriptFilenameFix();
- mediaFrame.scriptAudioFile = getAudioFilenameFix();
- loadScriptText(ai.videoScriptFile.text);
- }
- function hideAllTemplates()
- {
- var i = 0;
- while(i < templateList.length)
- {
- trace("HIDING TEMPLATE: " + templateList[i].name);
- this[templateList[i].name]._visible = false;
- i++;
- }
- }
- if(_global.PMSI == null)
- {
- _global.PMSI = {};
- PMSI.VENDOR_NAME = "Purple Monkey Studios, Inc.";
- PMSI.DefList = {};
- }
- String.prototype.trim = function()
- {
- return this.rtrim().ltrim();
- };
- String.prototype.rtrim = function()
- {
- var i = this.length - 1;
- while(i >= 0 && this.charCodeAt(i) <= 32)
- {
- i--;
- }
- return this.substring(0,i + 1);
- };
- String.prototype.ltrim = function()
- {
- var i = 0;
- while(i < this.length && this.charCodeAt(i) <= 32)
- {
- i++;
- }
- return this.substring(i);
- };
- String.prototype.isWhiteSpace = function()
- {
- var i = 0;
- while(i < this.length)
- {
- if(this.charCodeAt(i) > 32)
- {
- return false;
- }
- i++;
- }
- return true;
- };
- String.prototype.toCharArray = function()
- {
- return this.split("");
- };
- Array.prototype.charArrayToString = function()
- {
- return this.join("");
- };
- String.prototype.reverse = function()
- {
- return this.split("").reverse().join("");
- };
- String.prototype.multiSplit = function()
- {
- var master;
- var dummy;
- var args;
- master = this.split(arguments[0]);
- var i = 1;
- while(i < arguments.length)
- {
- var j = 0;
- while(j < master.length)
- {
- dummy = master[j].split(arguments[i]);
- if(dummy.length > 1)
- {
- args = [j,1];
- args = args.concat(dummy);
- master.splice.apply(master,args);
- }
- j++;
- }
- i++;
- }
- return master;
- };
- String.prototype.replace = function(srch, repl)
- {
- return this.split(srch).join(repl);
- };
- XML.prototype.ELEMENT_NODE = 1;
- XML.prototype.TEXT_NODE = 3;
- XML.prototype._inorderItr = function(node, fnPtr)
- {
- var stack = new Array();
- var node = node;
- while(true)
- {
- if(node)
- {
- stack.push(node);
- node = node.firstChild;
- }
- else
- {
- node = stack.pop();
- if(!node)
- {
- break;
- }
- fnPtr(node);
- node = node.nextSibling;
- }
- }
- delete stack;
- };
- XMLNode.prototype._inorderItr = XML.prototype._inorderItr;
- XML.prototype._inorderRec = function(node, fnPtr)
- {
- function helperR(node_xml)
- {
- if(node_xml == null)
- {
- return undefined;
- }
- this.fnPtr(node_xml);
- helperR(node_xml.firstChild);
- helperR(node_xml.nextSibling);
- }
- var outer = this;
- helperR(node);
- };
- XMLNode.prototype._inorderRec = XML.prototype._inorderRec;
- XMLNode.prototype.addProperty("text",this.ext_XML_GET_TEXT,this.ext_XML_SET_TEXT);
- XML.prototype.addProperty("text",this.ext_XML_GET_TEXT,this.ext_XML_SET_TEXT);
- XML.prototype.getElementsByTagName = function(tagName)
- {
- function processNode(node)
- {
- if(node.nodeName != null && node.nodeName == tagName)
- {
- nodelist.push(node);
- }
- }
- var nodelist = new Array();
- this._inorderItr(this,processNode);
- return nodelist;
- };
- XMLNode.prototype.getElementsByTagName = XML.prototype.getElementsByTagName;
- XML.prototype.getElementsByTagNames = function()
- {
- function processNode(node)
- {
- var i = 0;
- while(i < args.length)
- {
- if(node.nodeName != null && node.nodeName == args[i])
- {
- trace("Found: " + args[i]);
- if(nodelists[i] == undefined)
- {
- nodelists[i] = new Array();
- }
- nodelists[i].push(node);
- break;
- }
- i++;
- }
- }
- var args = arguments;
- var nodelists = new Array(arguments.length);
- this._inorderItr(this,processNode);
- return nodelists;
- };
- XMLNode.prototype.getElementsByTagNames = XML.prototype.getElementsByTagNames;
- XML.prototype.getValueAtTagName = function(tagName)
- {
- function processNode(node)
- {
- if(node.nodeName != null && node.nodeName == tagName)
- {
- nodelist.push(node);
- }
- }
- var nodelist = new Array();
- var textValue = null;
- this._inorderItr(this,processNode);
- if(nodeList.length >= 1)
- {
- textValue = nodeList[0].text;
- }
- return textValue;
- };
- XMLNode.prototype.getValueAtTagName = XML.prototype.getValueAtTagName;
- XML.prototype.getAttribute = function(name)
- {
- return this.attributes[name];
- };
- XMLNode.prototype.getAttribute = XML.prototype.getAttribute;
- XML.prototype.setAttribute = function(name, value)
- {
- this.attributes[name] = value;
- };
- XMLNode.prototype.setAttribute = XML.prototype.setAttribute;
- XML.prototype.hasAttribute = function(name)
- {
- var attrs = this.attributes;
- for(var mc in attrs)
- {
- if(name == mc)
- {
- return true;
- }
- }
- return false;
- };
- XMLNode.prototype.hasAttribute = XML.prototype.hasAttribute;
- XML.prototype.removeAttribute = function(name)
- {
- var attr = this.attributes[name];
- delete this.attributes[name];
- return attr;
- };
- XMLNode.prototype.setAttribute = XML.prototype.setAttribute;
- XMLNode.prototype.getOwnerDocument = function()
- {
- var odc = this;
- var lastNode = this;
- while(odc)
- {
- lastNode = odc;
- odc = odc.parentNode;
- }
- return !(lastNode instanceof XML) ? null : lastNode;
- };
- XML.prototype.normalize = function()
- {
- function process(node)
- {
- nodeList.push(node);
- }
- var outer = this;
- var nodeList = new Array();
- this._inorderItr(this,process);
- var i = 0;
- while(i < nodeList.length)
- {
- var node = nodeList[i];
- if(node.nodeType == XML.prototype.TEXT_NODE && node.nodeValue.isWhiteSpace())
- {
- trace("removing node");
- node.removeNode();
- }
- else if(node.nodeType == XML.prototype.TEXT_NODE)
- {
- node.nodeValue = node.nodeValue.trim();
- }
- i++;
- }
- delete nodeList;
- };
- XMLNode.prototype.normalize = XML.prototype.normalize;
- XMLNode.prototype.getDepth = function()
- {
- var i = 0;
- var node = this;
- while(node)
- {
- node = node.parentNode;
- i++;
- }
- return i;
- };
- XML.prototype.getElementsWithAttribute = function(name, value)
- {
- function processNode(node)
- {
- if(value == null)
- {
- for(var mcz in node.attributes)
- {
- if(mcz == name)
- {
- nodeList.push(node);
- break;
- }
- }
- }
- else if(node.attributes[name] == value)
- {
- nodeList.push(node);
- }
- }
- if(name == null)
- {
- return undefined;
- }
- var nodeList = new Array();
- this._inorderItr(this,processNode);
- return nodeList;
- };
- XMLNode.prototype.getElementsWithAttribute = XML.prototype.getElementsWithAttribute;
- XMLNode.prototype.getPath = function(path)
- {
- function process(node)
- {
- trace(node.nodeName);
- if(node.nodeName != null && node.nodeName == currentPart && i < pathParts.length)
- {
- trace("Found: " + currentPart);
- partTable[i] = node.parentNode.getElementsByTagName(currentPart);
- currentPart = pathParts[++i];
- }
- }
- var i = 0;
- var pathParts = path.split("/");
- var currentPart = pathParts[i];
- var partTable = new Array();
- this._inorderItr(this,process);
- return partTable[partTable.length - 1];
- };
- XML.prototype.getPath = XMLNode.prototype.getPath;
- MovieClip.prototype.isLoading = function()
- {
- return this.getBytesLoaded() > 4 && this.getBytesTotal() > this.getBytesLoaded();
- };
- MovieClip.prototype.getPercentLoaded = function()
- {
- return Math.round(this.getBytesLoaded() / this.getBytesTotal() * 100);
- };
- MovieClip.prototype.isLoaded = function()
- {
- return !this.isLoading();
- };
- MovieClip.prototype._sol = function(f)
- {
- if(MovieClip.prototype.__onLoadHandler__ == undefined)
- {
- MovieClip.prototype.__onLoadHandler__ = {};
- }
- MovieClip.prototype.__onLoadHandler__[this] = f;
- };
- MovieClip.prototype._gol = function()
- {
- return MovieClip.prototype.__onLoadHandler__[this];
- };
- MovieClip.prototype.addProperty("onLoad",MovieClip.prototype._gol,MovieClip.prototype._sol);
- MovieClip.prototype._sod = function(f)
- {
- if(MovieClip.prototype.__onDataHandler__ == undefined)
- {
- MovieClip.prototype.__onDataHandler__ = {};
- }
- MovieClip.prototype.__onDataHandler__[this] = f;
- };
- MovieClip.prototype._god = function()
- {
- return MovieClip.prototype.__onDataHandler__[this];
- };
- MovieClip.prototype.addProperty("onData",MovieClip.prototype._god,MovieClip.prototype._sod);
- MovieClip.prototype.load = MovieClip.prototype.loadMovie;
- MovieClip.prototype.drawOval = function(x, y, radius, yRadius)
- {
- if(arguments.length < 3)
- {
- return undefined;
- }
- var theta;
- var xrCtrl;
- var yrCtrl;
- var angle;
- var angleMid;
- var px;
- var py;
- var cx;
- var cy;
- if(yRadius == undefined)
- {
- yRadius = radius;
- }
- theta = 0.7853981633974483;
- xrCtrl = radius / Math.cos(theta / 2);
- yrCtrl = yRadius / Math.cos(theta / 2);
- angle = 0;
- this.moveTo(x + radius,y);
- var i = 0;
- while(i < 8)
- {
- angle += theta;
- angleMid = angle - theta / 2;
- cx = x + Math.cos(angleMid) * xrCtrl;
- cy = y + Math.sin(angleMid) * yrCtrl;
- px = x + Math.cos(angle) * radius;
- py = y + Math.sin(angle) * yRadius;
- this.curveTo(cx,cy,px,py);
- i++;
- }
- };
- MovieClip.prototype.drawCircle = function(x, y, r)
- {
- this.drawOval(x,y,r);
- };
- MovieClip.prototype.drawSquare = function(x, y, w)
- {
- this.drawRect(x,y,w,w);
- };
- MovieClip.prototype.drawEgg = function(x, y, r)
- {
- var rx = r / 1.618;
- var ry = r;
- var ry1 = 2 * ry * 0.618;
- var ry2 = 2 * ry * 0.382;
- this.moveTo(x + rx,y);
- this.curveTo(rx + x,-0.4142 * ry1 + y,0.7071 * rx + x,-0.7071 * ry1 + y);
- this.curveTo(0.4142 * rx + x,- ry1 + y,x,- ry1 + y);
- this.curveTo(-0.4142 * rx + x,- ry1 + y,-0.7071 * rx + x,-0.7071 * ry1 + y);
- this.curveTo(- rx + x,-0.4142 * ry1 + y,- rx + x,y);
- this.curveTo(- rx + x,0.4142 * ry2 + y,-0.7071 * rx + x,0.7071 * ry2 + y);
- this.curveTo(-0.4142 * rx + x,ry2 + y,x,ry2 + y);
- this.curveTo(0.4142 * rx + x,ry2 + y,0.7071 * rx + x,0.7071 * ry2 + y);
- this.curveTo(rx + x,0.4142 * ry2 + y,rx + x,y);
- };
- MovieClip.prototype.drawRect = function(x, y, w, h, cornerRadius)
- {
- if(arguments.length < 4)
- {
- return undefined;
- }
- if(cornerRadius > 0)
- {
- var theta;
- var angle;
- var cx;
- var cy;
- var px;
- var py;
- if(cornerRadius > Math.min(w,h) / 2)
- {
- cornerRadius = Math.min(w,h) / 2;
- }
- theta = 0.7853981633974483;
- this.moveTo(x + cornerRadius,y);
- this.lineTo(x + w - cornerRadius,y);
- angle = -1.5707963267948966;
- cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- angle += theta;
- cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- this.lineTo(x + w,y + h - cornerRadius);
- angle += theta;
- cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- angle += theta;
- cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- this.lineTo(x + cornerRadius,y + h);
- angle += theta;
- cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- angle += theta;
- cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- this.lineTo(x,y + cornerRadius);
- angle += theta;
- cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- angle += theta;
- cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- }
- else
- {
- this.moveTo(x,y);
- this.lineTo(x + w,y);
- this.lineTo(x + w,y + h);
- this.lineTo(x,y + h);
- this.lineTo(x,y);
- }
- };
- MovieClip.prototype.getCenterPoint = function()
- {
- return {x:this._width / 2,y:this._height / 2};
- };
- MovieClip.prototype.drawDebugBorderD = function()
- {
- this.lineStyle(1,0,25);
- var x;
- var y = 0;
- var w = this._width;
- var h = this._height;
- this.moveTo(x,y);
- this.lineTo(x + w,y);
- this.lineTo(x + w,y + h);
- this.lineTo(x,y + h);
- this.lineTo(x,y);
- };
- MovieClip.prototype.drawUnderline = function(len)
- {
- len = len != null ? len : this._width;
- this.moveTo(0,this._height);
- this.lineTo(len,this._height);
- };
- if(PMSI.DepthManager == undefined)
- {
- PMSI.DepthManager = {};
- PMSI.DepthManager._$depth = 0;
- PMSI.DepthManager.getNextDepth = function()
- {
- var next_depth = ++this._$depth;
- while(this._$depthsClaimed["dc" + next_depth])
- {
- next_depth = ++this._$depth;
- }
- return next_depth;
- };
- PMSI.DepthManager.reserveDepth = function(d)
- {
- if(this._$depthsClaimed == null)
- {
- this._$depthsClaimed = {};
- }
- if(d == null)
- {
- var d = ++this._$depth;
- }
- while(this._$depthsClaimed["dc" + d])
- {
- d++;
- }
- this._$depthsClaimed["dc" + d] = d;
- return d;
- };
- }
- ActivityInfoItem.prototype.toString = function()
- {
- return this.text;
- };
- ActivityInfo.prototype.getIdString = function(separator)
- {
- var sep = separator != null ? separator : ".";
- var idStr = "C" + this.activity.course + sep;
- idStr += "U" + this.activity.unit + sep;
- idStr += "S" + this.activity.section + sep;
- idStr += this.activity.topic + sep;
- if(this.activity.topicSet)
- {
- idStr += this.activity.topicSet + sep;
- }
- idStr += this.activity.difficultyLevel + this.activity.number.text;
- return idStr;
- };
- ActivityInfo.prototype.getId = ActivityInfo.prototype.getIdString;
- ActivityInfo.prototype.getType = function()
- {
- return this.activity.type;
- };
- ActivityInfo.prototype.hasAudio = function()
- {
- return this.activity.audioFile == null ? false : true;
- };
- ActivityInfo.prototype.hasVideo = function()
- {
- return this.activity.videoFile == null ? false : true;
- };
- ActivityInfo.prototype.hasPicture = function()
- {
- return this.activity.artFile == null ? false : true;
- };
- ActivityInfo.prototype.setResolve = function()
- {
- this.__resolve = ActivityInfo.prototype._myResolve;
- };
- ActivityInfo.prototype._myResolve = function(name)
- {
- return this.activity[name];
- };
- ActivityInfo.prototype.getBytesLoaded = function()
- {
- return this.xmlSource.getBytesLoaded();
- };
- ActivityInfo.prototype.getBytesTotal = function()
- {
- return this.xmlSource.getBytesTotal();
- };
- ActivityInfo.prototype.load = function(url)
- {
- this._reset();
- this.xmlSource = new XML();
- var x = this.xmlSource;
- x.parent = this;
- x.ignoreWhite = true;
- x.createAttributeArray = function(attrs)
- {
- };
- x.onLoad = function(success)
- {
- function helperR(node_xml, obj)
- {
- if(node_xml == null)
- {
- return undefined;
- }
- var nName = node_xml.nodeName;
- if(nName == "number")
- {
- nName = "activityNumber";
- }
- if(nName != null && obj[nName] == null)
- {
- var newObj = new ActivityInfoItem();
- newObj.text = node_xml.text.trim();
- if(node_xml.attributes)
- {
- trace("creating new attributes array");
- newObj.attributes = {};
- for(var oname in node_xml.attributes)
- {
- newObj.attributes[oname] = node_xml.attributes[oname];
- }
- }
- obj[nName] = newObj;
- }
- else if(!(obj[nName] instanceof Array) && obj[nName] != null)
- {
- var temp = obj[nName];
- obj[nName] = [];
- obj[nName].push(temp);
- }
- var childObject = obj[nName];
- if(childObject instanceof Array)
- {
- var newObj = new ActivityInfoItem();
- newObj.text = node_xml.text.trim();
- if(node_xml.attributes)
- {
- trace("creating new attributes array");
- newObj.attributes = {};
- for(var oname in node_xml.attributes)
- {
- newObj.attributes[oname] = node_xml.attributes[oname];
- }
- }
- childObject = newObj;
- obj[nName].push(childObject);
- }
- helperR(node_xml.firstChild,childObject);
- helperR(node_xml.nextSibling,obj);
- }
- if(success)
- {
- helperR(this.firstChild,this.parent);
- this.parent.setResolve();
- }
- this.parent.onLoad(success);
- };
- x.load(url);
- };
- ActivityInfo.prototype._reset = function()
- {
- delete this.xmlSource;
- delete this.__resolve;
- delete this.activity;
- };
- TableClass = function(parent)
- {
- this.parent = parent;
- this.reduceTextFields = true;
- this.rows = [];
- this.maxCellDims = {width:0,height:0};
- this.cellPadding = 4;
- this.cellSpacing = 4;
- this.colWidthMaxs = [];
- this.colPercentTable = [];
- this.borderSize = 1;
- this.width = 0;
- this.height = 0;
- this.oldWidth = this.width;
- this.oldHeight = this.oldHeight;
- this.originalWidth = 0;
- this.x = 0;
- this.y = 0;
- this.alteredColumns = {};
- var dep = PMSI.DepthManager.getNextDepth();
- this.borderClip = parent.createEmptyMovieClip("TableClassBorder" + dep,dep);
- };
- TableClass.prototype.setPosition = function(position)
- {
- this.x = position.x;
- this.y = position.y;
- };
- TableClass.prototype.getPosition = function()
- {
- return {x:this.x,y:this.y};
- };
- TableClass.prototype.setBorder = function(bsize)
- {
- this.borderSize = bsize;
- };
- TableClass.prototype.addRow = function(newRow)
- {
- this.rows.push(newRow);
- var cells = newRow.cells;
- var cellCount = cells.length;
- var cwms = this.colWidthMaxs;
- var cw = null;
- var newWidth = 0;
- var con = null;
- var c = 0;
- while(c < cellCount)
- {
- con = cells[c].getContent();
- cw = con == null ? cells[c].width : con._width;
- if(cwms[c] == null)
- {
- cwms[c] = cw;
- }
- else
- {
- cwms[c] = cw <= cwms[c] ? cwms[c] : cw;
- }
- newWidth += cwms[c];
- c++;
- }
- this.originalWidth = newWidth;
- this.width = newWidth;
- trace("NEW WIDTH: " + this.width);
- };
- TableClass.prototype.addRowSpacer = function(height, width, numCols)
- {
- if(numCols == null && this.rows.length == 0)
- {
- return undefined;
- }
- numCols = this.rows[0].cells.length;
- var spacerRow = new TableRow();
- var spacerCell = null;
- var i = 0;
- while(i < numCols)
- {
- spacerCell = new TableCell();
- spacerCell.height = height;
- spacerCell.width = width;
- spacerRow.addCell(spacerCell);
- i++;
- }
- this.addRow(spacerRow);
- };
- TableClass.prototype.setCellPadding = function(cellPadding)
- {
- this.cellPadding = cellPadding;
- this.redraw();
- };
- TableClass.prototype.setCellSpacing = function(cellSpacing)
- {
- this.cellSpacing = cellSpacing;
- this.redraw();
- };
- TableClass.prototype.setWidth = function(width)
- {
- this.oldWidth = this.width;
- this.width = width;
- this._recalcDimensions(width);
- this.redraw();
- this.redraw();
- };
- TableClass.prototype.setHeight = function(height)
- {
- this.oldHeight = this.height;
- this.height = height;
- this.redraw();
- };
- TableClass.prototype.redraw = function()
- {
- this.borderClip.clear();
- var rows = this.rows;
- var rc = rows.length;
- var tmdims = this.maxCellDims;
- var x;
- var y;
- var r;
- var cc;
- var con;
- var cols;
- var rmdims;
- var cell;
- var cmax;
- var offset;
- var voffset;
- var cwid;
- var wprec;
- var newwid;
- var lastColMax = null;
- var cpad = this.cellPadding;
- var cspace = this.cellSpacing;
- var r = 0;
- while(r < rc)
- {
- cols = rows[r].cells;
- cc = cols.length;
- rmdims = rows[r - 1].maxCellDims;
- if(r == 0)
- {
- y = this.y;
- }
- else
- {
- y += rmdims.height + this.cellSpacing;
- }
- var c = 0;
- while(c < cc)
- {
- cell = cols[c];
- con = cell.getContent();
- cwid = this.colWidthMaxs[c];
- this._resizeTextfield(con,cwid);
- if(cell.halign == "right")
- {
- offset = cwid - con._width;
- }
- else if(cell.halign == "center")
- {
- offset = (cwid - con._width) / 2;
- }
- else
- {
- offset = 0;
- }
- if(cell.valign == "bottom")
- {
- voffset = rows[r].maxCellDims.height - con._height;
- }
- else if(cell.valign == "center")
- {
- voffset = (rows[r].maxCellDims.height - con._height) / 2;
- }
- else
- {
- voffset = 0;
- }
- if(c == 0)
- {
- x = this.x;
- lastColMax = cwid;
- }
- else
- {
- cmax = lastColMax;
- x += cmax + this.cellSpacing;
- }
- con._x = x + offset;
- con._y = y + voffset;
- if(this.borderSize > 0)
- {
- this.borderClip.lineStyle(this.borderSize,10066329,100);
- this.borderClip.drawRect(x,y,cwid,rows[r].maxCellDims.height);
- }
- lastColMax = cwid;
- c++;
- }
- r++;
- }
- this._recalcHeights();
- };
- TableClass.prototype._resizeTextfield = function(oIns, w, h)
- {
- var txt = oIns.content;
- if(txt._width > w)
- {
- txt.wordWrap = true;
- txt._width = w;
- txt._width = Math.round(txt._width);
- trace("text width: " + txt.textWidth);
- if(this.reduceTextFields)
- {
- var h = txt._height;
- var w = txt._width;
- var old_w = 0;
- var txtWidth = txt.textWidth;
- var i = w;
- while(h == txt._height)
- {
- if(i <= 0)
- {
- break;
- }
- if(txt.textWidth < txtWidth)
- {
- break;
- }
- txt._width--;
- i--;
- }
- txt._width = txt._width + 1;
- }
- }
- oIns._width = txt._width;
- };
- TableClass.prototype._recalcHeights = function()
- {
- var rows = this.rows;
- var rc = rows.length;
- var cc;
- var cols;
- var cell;
- this.height = 0;
- var r = 0;
- while(r < rc)
- {
- cols = rows[r].cells;
- cc = cols.length;
- var c = 0;
- while(c < cc)
- {
- cell = cols[c];
- rows[r]._checkMaxCellDims(cell);
- this.height += rows[r].maxCellDims.height;
- c++;
- }
- r++;
- }
- };
- TableClass.prototype._findLargestColumn = function()
- {
- var largestId;
- var largest;
- var cmaxs = this.colWidthMaxs;
- var i = 0;
- while(i < cmaxs.length)
- {
- trace("finding largest: " + cmaxs[i]);
- if(largest < cmaxs[i])
- {
- largest = cmaxs[i];
- largestId = i;
- }
- i++;
- }
- return largestId;
- };
- TableClass.prototype._recalcDimensions = function(newWidth)
- {
- var cw = this._getTableWidth();
- if(newWidth > cw)
- {
- return undefined;
- }
- trace("\n\n----");
- trace("TableClass.prototype._recalcDimensions:");
- trace("current width: " + cw + ", new width: " + newWidth);
- delete this.alteredColumns;
- this.alteredColumns = {};
- this._resizeTableR(cw,newWidth);
- var addback = newWidth - this._getTableWidth();
- var cmaxs = this.colWidthMaxs;
- var prc;
- var cmax = 0;
- var acc = 0;
- for(var nm in this.alteredColumns)
- {
- trace("ALTERED COLUMNS: " + nm);
- if(!isNaN(nm))
- {
- acc++;
- }
- }
- for(var colid in this.alteredColumns)
- {
- trace("Addback: " + colid + ", " + addback / acc);
- this.colWidthMaxs[parseInt(colid)] = this.colWidthMaxs[parseInt(colid)] + addback / acc;
- }
- if(addback / acc > 0)
- {
- }
- this.width = newWidth;
- };
- TableClass.prototype._resizeTableR = function(lastWidth, targetWidth)
- {
- if(lastWidth <= targetWidth)
- {
- return undefined;
- }
- var largest;
- var largestId = 0;
- var cmaxs = this.colWidthMaxs;
- var i = 0;
- while(i < cmaxs.length)
- {
- trace("finding largest: " + cmaxs[i]);
- if(largest < cmaxs[i])
- {
- largest = cmaxs[i];
- largestId = i;
- }
- i++;
- }
- var prc = largest / lastWidth;
- trace("prc: " + prc);
- var ncw = largest * prc;
- cmaxs[largestId] = ncw;
- this.alteredColumns[largestId] = largestId;
- trace("\n\nAFTER:");
- trace("new largest: " + ncw);
- trace("lastWidth: " + lastWidth);
- trace("largest: " + largest);
- trace("targetWidth: " + targetWidth);
- trace("nextWidth: " + (lastWidth - (largest - ncw)));
- if(prc == 1)
- {
- cmax[largestId] = targetWidth;
- return undefined;
- }
- this._resizeTableR(lastWidth - (largest - ncw),targetWidth);
- };
- TableClass.prototype._getTableWidth = function()
- {
- var width = 0;
- var lasti = this.colWidthMaxs.length - 1;
- var i = 0;
- while(i < this.colWidthMaxs.length)
- {
- width += this.colWidthMaxs[i];
- i++;
- }
- return width;
- };
- TableClass.prototype.init = function()
- {
- this.redraw();
- };
- TableRow = function()
- {
- this.cells = [];
- this.maxCellDims = {width:0,height:0};
- };
- TableRow.prototype.addCell = function(cell)
- {
- this.cells.push(cell);
- var cc = cell.getContent();
- var cw = cc == null ? cell.width : cc._width;
- var ch = cc == null ? cell.height : cc._height;
- var mw = this.maxCellDims.width;
- var mh = this.maxCellDims.height;
- this.maxCellDims.width = cw <= mw ? mw : cw;
- this.maxCellDims.height = ch <= mh ? mh : ch;
- };
- TableRow.prototype._checkMaxCellDims = function(cell)
- {
- var cc = cell.getContent();
- var cw = cc == null ? cell.width : cc._width;
- var ch = cc == null ? cell.height : cc._height;
- var mw = this.maxCellDims.width;
- var mh = this.maxCellDims.height;
- this.maxCellDims.width = cw <= mw ? mw : cw;
- this.maxCellDims.height = ch <= mh ? mh : ch;
- };
- TableCell = function(content)
- {
- this.content = content;
- };
- TableCell.prototype.setContent = function(content)
- {
- this.content = content;
- };
- TableCell.prototype.getContent = function()
- {
- return this.content;
- };
- TableCell.prototype.setWidth = function(width, isPercent)
- {
- this.widthIsPercent = isPercent != null ? true : false;
- this.width = width;
- };
- TableCell.prototype.setHeight = function(height, isPercent)
- {
- this.heightIsPercent = isPercent != null ? true : false;
- this.height = height;
- };
- TableCell.prototype.setHAlign = function(halign)
- {
- this.halign = halign;
- };
- TableCell.prototype.setVAlign = function(valign)
- {
- this.valign = valign;
- };
- Array.prototype.enqueue = function(obj)
- {
- this.push(obj);
- };
- Array.prototype.dequeue = function()
- {
- return this.shift();
- };
- Queue.prototype.enqueue = function(obj)
- {
- this.q.enqueue(obj);
- };
- Queue.prototype.dequeue = function()
- {
- return this.q.dequeue();
- };
- Queue.prototype.getSize = function()
- {
- return this.q.length;
- };
- Queue.prototype.reset = function()
- {
- delete this.q;
- this.q = new Array();
- };
- Queue.prototype.isEmpty = function()
- {
- return this.getSize() == 0;
- };
- TextFormat.prototype.cGetTextExtent = function(s, bEmbedFonts, bAccurate)
- {
- var __CGTE_mc = _root.createEmptyMovieClip("__PMSI_textExtBox__",4013145);
- __CGTE_mc._visible = false;
- __CGTE_mc.createTextField("content",1,0,0,0,0);
- var __CGTE_mc_txt = __CGTE_mc.content;
- __CGTE_mc_txt.autoSize = true;
- var __CGTE_marg_h = bAccurate != true ? 0 : __CGTE_mc_txt._height;
- var __CGTE_marg_v = bAccurate != true ? 0 : __CGTE_mc_txt._width;
- __CGTE_mc_txt.embedFonts = bEmbedFonts != null ? bEmbedFonts : true;
- __CGTE_mc_txt.type = "dynamic";
- __CGTE_mc_txt.selectable = false;
- __CGTE_mc_txt.text = s;
- __CGTE_mc_txt.setTextFormat(this);
- return {width:__CGTE_mc_txt._width - __CGTE_marg_h,height:__CGTE_mc_txt._height - __CGTE_marg_v};
- };
- TextField.prototype.findLines = function(ttf)
- {
- var mc2 = _root.createEmptyMovieClip("__getLinesBox__",4013146);
- mc2._visible = false;
- ttf = ttf != null ? ttf : this.getTextFormat();
- var lh = ttf.cGetTextExtent("373_<3_4").height;
- var lines = [];
- mc2.createTextField("__fio__",1000,0,0,0,0);
- var f = mc2.__fio__;
- var als = this.text.split(" ");
- f._width = this._width;
- f.embedFonts = this.embedFonts;
- f.border = this.border;
- f.type = "dynamic";
- f.autoSize = true;
- f.selectable = false;
- f.wordWrap = true;
- f.multiline = true;
- var line = "";
- var i = 0;
- while(i < als.length)
- {
- f.text += " " + als[i];
- f.setTextFormat(ttf);
- if(f._height > lh && line != "")
- {
- lines.push(line.trim());
- f.text = "";
- line = "";
- i--;
- }
- line = f.text;
- f.setTextFormat(ttf);
- i++;
- }
- lines.push(f.text.trim());
- f.removeTextField();
- this.__lines = lines;
- return lines;
- };
- TextField.prototype.getLineAt = function(i)
- {
- if(this.__lines == null)
- {
- this.findLines();
- }
- return this.__lines[i];
- };
- TextField.prototype.getLineCount = function()
- {
- if(this.__lines == null)
- {
- this.findLines();
- }
- return this.__lines.length;
- };
- TextField.prototype.convertToLines = function()
- {
- if(this.__lines == null)
- {
- this.findLines();
- }
- this.text = "";
- var i = 0;
- while(i < this.__lines.length - 1)
- {
- this.text += this.__lines[i] + "\n";
- i++;
- }
- this.text += this.__lines[this.__lines.length - 1];
- };
- TextField.prototype.getLines = function()
- {
- if(this.__lines == null)
- {
- this.findLines();
- }
- return this.__lines;
- };
- var DIALOG_DEPTH = 1200;
- loadingBox._visible = false;
- if(_parent)
- {
- this._visible = false;
- if(_parent.isTester != true)
- {
- btnToggleLang._visible = false;
- }
- }
- refPath = "reference";
- videoPath = "video";
- audioPath = "audio/listening";
- artPath = "artfiles";
- scriptPath = "activities/scripts";
- videoSetupPath = videoPath;
- testFile = "test_dialog.xml";
- templateQueue = new Queue();
- templateList = [];
- templateList[0] = {};
- templateList[0].file = "template1.swf";
- templateList[0].name = "template1";
- templateList[1] = {};
- templateList[1].file = "template2.swf";
- templateList[1].name = "template2";
- templateList[2] = {};
- templateList[2].file = "template3.swf";
- templateList[2].name = "template3";
- templateList[3] = {};
- templateList[3].file = "template4.swf";
- templateList[3].name = "template4";
- templateList[4] = {};
- templateList[4].file = "template5.swf";
- templateList[4].name = "template5";
- templateList[5] = {};
- templateList[5].file = "template6.swf";
- templateList[5].name = "template6";
- templateList[6] = {};
- templateList[6].file = "template7.swf";
- templateList[6].name = "template7";
- var i = 0;
- while(i < templateList.length)
- {
- templateQueue.enqueue(templateList[i]);
- i++;
- }
- activityTypes = [];
- activityTypes.SWITCH = 1;
- activityTypes.FILL_IN = 2;
- activityTypes.SHORT = 3;
- activityTypes.MATCH = 4;
- activityTypes.MULTI = 5;
- activityTypes.TABLE = 6;
- activityTypes.VIDEO = 7;
- activityTypes[activityTypes.SWITCH] = "template1";
- activityTypes[activityTypes.FILL_IN] = "template2";
- activityTypes[activityTypes.SHORT] = "template3";
- activityTypes[activityTypes.MATCH] = "template4";
- activityTypes[activityTypes.MULTI] = "template5";
- activityTypes[activityTypes.TABLE] = "template6";
- activityTypes[activityTypes.VIDEO] = "template7";
- styles = {};
- styles.VIDEO = 1;
- styles.ART = 2;
- styles.AUDIO = 3;
- actBulletPosition = {};
- actBulletPosition.topx = actBullet._x;
- actBulletPosition.topy = actBullet._y;
- actBulletPosition.botx = 0;
- actBulletPosition.boty = 0;
- actAnswerPosition = {};
- actAnswerPosition.inix = 457;
- actAnswerPosition.iniy = 500;
- actAnswerPosition.secx = 694;
- actAnswerPosition.secy = 500;
- actAnswerPosition.pos1_x = 694;
- actAnswerPosition.pos1_y = 500;
- actAnswerPosition.pos2_x = 694;
- actAnswerPosition.pos2_y = 436;
- var layoutInfo = {};
- layoutInfo.actBulletTextColor = 16777215;
- layoutInfo.titleTextColor = 10053375;
- layoutInfo.answerRollOverColor = 16695085;
- layoutInfo.answerRollOutColor = layoutInfo.titleTextColor;
- layoutInfo.answerSelectColor = layoutInfo.titleTextColor;
- layoutInfo.questionTextColor = 2309272;
- layoutInfo.instTextColor = 2309272;
- layoutInfo.answerIncorrectColor = 16695085;
- layoutInfo.doAnswerFill = false;
- layoutInfo.rightSideBuffer = 10;
- layoutInfo.box = {};
- layoutInfo.box.x = 260;
- layoutInfo.box.y = 93;
- layoutInfo.box.views = [];
- layoutInfo.box.widthWithBox = 300;
- layoutInfo.box.heightWithBox = 300;
- layoutInfo.box.widthWithoutBox = 300;
- layoutInfo.box.heightWithoutBox = 300;
- layoutinfo.MAX_WIDTH = 520;
- layoutInfo.MAX_HEIGHT = 380;
- layoutInfo.questionIndent = 30;
- layoutInfo.selectionRadius = 6;
- layoutInfo.drawSelectionCircle = true;
- layoutInfo.lineSpacing = 5;
- layoutInfo.selectionBorderThickness = 1;
- layoutInfo.instTextFormat = new TextFormat();
- layoutInfo.instTextFormat.font = "Formata_Normal";
- layoutInfo.instTextFormat.size = 12;
- layoutInfo.instTextFormat.color = layoutInfo.instTextColor;
- layoutInfo.instTextFormatBold = new TextFormat();
- layoutInfo.instTextFormatBold.font = "Formata_Bold";
- layoutInfo.instTextFormatBold.size = 12;
- layoutInfo.instTextFormatBold.color = layoutInfo.instTextColor;
- layoutInfo.qTextFormat = new TextFormat();
- layoutInfo.qTextFormat.font = "Formata_Normal";
- layoutInfo.qTextFormat.size = 12;
- layoutInfo.qTextFormat.color = layoutInfo.questionTextColor;
- layoutInfo.qTextFormat.align = "right";
- layoutInfo.qTextFormat.leading = 2;
- layoutInfo.qTextFormatSA = new TextFormat();
- layoutInfo.qTextFormatSA.font = "Formata_Normal";
- layoutInfo.qTextFormatSA.size = 12;
- layoutInfo.qTextFormatSA.color = layoutInfo.questionTextColor;
- layoutInfo.qTextFormatSA.leading = 2;
- layoutInfo.qTextFormatMATCH = new TextFormat();
- layoutInfo.qTextFormatMATCH.font = "Formata_Normal";
- layoutInfo.qTextFormatMATCH.size = 12;
- layoutInfo.qTextFormatMATCH.color = layoutInfo.questionTextColor;
- layoutInfo.qTextFormatMATCH.leading = 2;
- layoutInfo.qTextFormatBANK = new TextFormat();
- layoutInfo.qTextFormatBANK.font = "Formata_Normal";
- layoutInfo.qTextFormatBANK.size = 12;
- layoutInfo.qTextFormatBANK.color = layoutInfo.questionTextColor;
- layoutInfo.qTextFormatBANK.leading = 2;
- layoutInfo.qTextFormatMULTI = new TextFormat();
- layoutInfo.qTextFormatMULTI.font = "Formata_Normal";
- layoutInfo.qTextFormatMULTI.size = 12;
- layoutInfo.qTextFormatMULTI.color = layoutInfo.questionTextColor;
- layoutInfo.qTextFormatMULTI.leading = 2;
- layoutInfo.answerTextFormat1 = new TextFormat();
- layoutInfo.answerTextFormat1.font = "Formata_Normal";
- layoutInfo.answerTextFormat1.size = 12;
- layoutInfo.answerTextFormat1.color = layoutInfo.answerRollOutColor;
- layoutInfo.answerTextFormat2 = new TextFormat();
- layoutInfo.answerTextFormat2.font = "Formata_Normal";
- layoutInfo.answerTextFormat2.size = 12;
- layoutInfo.answerTextFormat2.color = layoutInfo.answerRollOutColor;
- layoutInfo.titleTextFormat = new TextFormat();
- layoutInfo.titleTextFormat.font = "TriplexCondSerifBlack";
- layoutInfo.titleTextFormat.size = 24;
- layoutInfo.titleTextFormat.color = layoutInfo.titleTextColor;
- layoutInfo.actBulletTextFormat = new TextFormat();
- layoutInfo.actBulletTextFormat.font = "Formata_Bold";
- layoutInfo.actBulletTextFormat.bold = true;
- layoutInfo.actBulletTextFormat.size = 14;
- layoutInfo.actBulletTextFormat.color = layoutInfo.actBulletTextColor;
- layoutInfo.actFeedbackColor = 10053375;
- layoutInfo.actCorrectFeedbackColor = 16695085;
- layoutInfo.actFeedbackTextFormat = new TextFormat();
- layoutInfo.actFeedbackTextFormat.font = "Formata_Bold";
- layoutInfo.actFeedbackTextFormat.size = 15;
- layoutInfo.actFeedbackTextFormat.color = layoutInfo.actFeedbackColor;
- layoutInfo.actCorrectFeedbackTextFormat = new TextFormat();
- layoutInfo.actCorrectFeedbackTextFormat.font = "Formata_Bold";
- layoutInfo.actCorrectFeedbackTextFormat.size = 15;
- layoutInfo.actCorrectFeedbackTextFormat.color = layoutInfo.actCorrectFeedbackColor;
- layoutInfo.matchingCircleColor = 16695085;
- layoutInfo.matchingCircleRadius = 4;
- layoutInfo.matchingCircleSpacer = 50;
- layoutInfo.matchingCircleLineThickness = 2;
- layoutInfo.matchingCircleVertOffset = 4;
- answerBtn.onRelease = function()
- {
- this.onRollOut();
- this._parent.currentActivity.checkAnswers();
- };
- answerBtn.onRollOver = function()
- {
- this.gotoAndStop("rollOver");
- };
- answerBtn.onRollOut = function()
- {
- this.gotoAndStop("rollOut");
- };
- answerBtn.onReleaseOutside = answerBtn.onRollOut;
- actInfo = new ActivityInfo();
- btnRefWin.onRollOver = function()
- {
- this.gotoAndStop(2);
- };
- btnRefWin.onRollOut = function()
- {
- this.gotoAndStop(1);
- };
- btnRefWin.onRelease = function()
- {
- setRefWinVisible(true);
- refWin.loadPaneSwf(refPath + "/" + ai.reference.file.text,parseInt(ai.reference.x.text),parseInt(ai.reference.y.text),parseInt(ai.reference.zoom.text));
- };
- btnRefWin.onReleaseOutside = btnRefWin.onRollOut;
-